<include file="__THEME__/public_header" />
<div class="content">
	<div class="wrap">
    	<div class="con_side">
        	<ul class="nav">
            	<li class="cursor"><a href="{:U('admin/Report/show_report_screen')}">市区级报告</a></li>
                <li><a href="{:U('admin/Report/show_garden_reports')}">园级报告</a></li>
                <li><a href="{:U('admin/Report/show_report_evaluate')}">评价报告</a></li>
                <li><a href="{:U('admin/Report/health_advice')}">体质改善方法</a></li>
            </ul>
        </div>
        <div class="con_main">
        	<div class="con_tit">
            	<ul class="con_link">
                	<li class="on"><a href="{:U('admin/Report/show_report_screen')}">筛选</a></li>
                </ul>
                <div class="search_wrap">
                	<form>
                    	<input class="search_inp" type="text" id="uname" value="" placeholder="按城市/地区搜索">
                        <input class="search_btn" type="button" value="" onclick="select_filter();">
                    </form>
                </div>
            </div>
            <form action="{:U('admin/Report/show_report_screen')}" method="post" name="form1">
            <div class="con_box">
            	<ul class="slect_list2">
                    <li>
                        <div class="txt">省名：</div>
                        <div class="inp">
                            <select name="province" id="province" onchange="selectArea(1)">
                                <option value="0">---请选择---</option>
                                <volist name="province" id="province">
                                    <option value="{$province.area_id}">{$province.title}</option>
                                </volist>
                            </select>
                        </div>
                    </li>
                    <li>
                        <div class="txt">市名：</div>
                        <div class="inp">
                            <select name="city" id="city" onchange="selectArea(2)">
                                <option value="0">---请选择---</option>
                            </select>
                        </div>
                    </li>
                    <li>
                        <div class="txt">区名：</div>
                        <div class="inp">
                            <select name="area" id="area">
                                <option value="0">---请选择---</option>
                            </select>
                        </div>
                    </li>
                </ul>
            	<div class="action_link tc small">
                	<a class="save" href="javascript:select_filter();">确定</a>
                </div>
            </div>
              </form>
            <div class="con_tit">
                <table class="table table_title t4">
                  <tbody>
                  <tr>
                    <td >报告名称</td>
                    <td>市/区名</td>
                    <td>已完成/总人数</td>
                    <td>操作</td>
                  </tr>
                </tbody></table>
            </div>
            <div class="con_box">
            	<table class="table table_list t4">
                  <tbody>
                  <if condition="$data['data']">
                  <volist name="data['data']" id="vo">
                  <tr>
                    <td><a target="_black" href="{:U('public/Report/NormalReport',array('rpt_id'=>$vo['rpt_id']))}">{$vo.rpt_name}</a></td>
                    <td>{$vo.name}</td>
                    <td>{$vo.num.test_num}/{$vo.num.sum}</td>
                    <td><a target="_black" href="{:U('public/Report/NormalReport',array('rpt_id'=>$vo['rpt_id']))}">打印</a></td>
                  </tr>
                  </volist>
                  <else/>
                    没有查询到相应报告
                  </if>
                </tbody></table>
            </div>
            {$data.html}
        </div>
    </div>
</div>
<script>
  function select_filter(){
      var city=$("#city").val();
      var uname=$("#uname").val();
      var area=$("#area").val();
      window.location.href = "{:U('admin/Report/show_report_screen')}"+"&city="+city+"&uname="+uname+"&area="+area; 
  }
    function selectArea(type){
        if(type==1){
            var pid=$("#province").val();
            var name="city";
        }else{
            var pid=$("#city").val();
            var name="area";
        }
        if(pid>0){
            $.ajax({
              type: "GET",
              url:"{:U('public/TestData/getArea')}",
              data:"pid="+pid,
              dataType:"json",
              success:function(data){
                $("#"+name).html("");
                $("#"+name).append("<option value='0'>---请选择---</option>");
                $.each(data,function(i,item){
                  $("#"+name).append("<option value='"+item.area_id+"'>"+item.title+"</option>");
                }); 
              }
            });
        }
    }
</script>
<include file="__THEME__/public_footer" />